#ifndef __SV2_GIMBAL_KEYBOARD__
#define __SV2_GIMBAL_KEYBOARD__

#include "sms_core.h"
#include <string>
#include <iostream>
#include <cstdlib>
#include <ncurses.h> // 用于非 Windows 环境下的键盘输入控制

namespace sv2
{
  class GimbalKeyBoardCppNode : public sms::BaseNode
  {
  public:
    GimbalKeyBoardCppNode(
        std::string job_name,
        std::string param_file,
        std::string ip = "127.0.0.1",
        int port = 9094) : sms::BaseNode("GimbalKeyBoardCppNode", job_name, param_file, ip, port),
                           _gimbal_ctl_pub("/" + job_name + "/gimbal/control", "spirecv_msgs::GimbalControl")
    {
      // 读取节点参数
      // double trackDef = this->get_param("trackDef", 50);
      // logger.info("trackDef: " + trackDef);
      initscr();            // 初始化 ncurses 模式
      raw();                // 禁止行缓冲
      keypad(stdscr, TRUE); // 启用功能键
      noecho();             // 禁止字符回显
    }
    ~GimbalKeyBoardCppNode()
    {
    }

    void run();

    double zoomScale = 1;
    double roll  = 0;
    double pitch = 0;
    double yaw   = 0;


  private:
    // 发布话题
    sms::Publisher _gimbal_ctl_pub;
  };
}
#endif
